<?php
/**
 *  NevuxBB - Free Forum Software
 *  Copyright (C) 2008, 2010 NevuxBB (No one specific author)This program is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 * Calendar
 * File: calendar.php
 * Purpose: Showing calendars
 * Todo: Allow different months/years
 *
 */
				
require('system/files/global.php');

// set page title
$core_template_system->setvar('page_title', 'Calendar');

// show the header loaded
$core_template_system->pparse();

// add this language file
$core_lang_system->reset();
$core_lang_system->add_file('calendar');

// build the menu
$core_template_system->setvar('breadcrumb', $core_nav_system->generateNav(array('settings' => array('level_down' => false,
																									'main_class' => 'menu'),
																				'information' => array('home' => array('data' => array(1 => 'Home',
																																	   2 => 1)),
																									   'cal'  => array('data' => array(1 => 'Calendar',
																																	   2 => 9))))));
// include calendar class
require(BASE_PATH . '/system/classes/calendar_class.php');

// initiate the class
$calendar = new Calendar;

// give the current month and year, for now
$calendar->calendar_dates = array('month' => date('n'),
								  'year'  => date('Y'));

// set this new data as a loop
$core_template_system->setloop('calendar_loop', $calendar->generateCalendar());

// set name
$core_template_system->setvar(array('date_name' => $calendar->calendar_text));

// render the page
$core_template_system->newTemplate(BASE_PATH . '/templates/' . ForumSettings::getCurrentTemplate() . '/calendar.html');
$core_template_system->pparse();

// display the footer
require('system/files/footer.php');
?>